library(tidyverse)
## -- Attaching packages --------------------------------------------------------------------- tidyverse 1.2.1 --
## v ggplot2 3.1.1     v purrr   0.3.2
## v tibble  2.1.1     v dplyr   0.8.1
## v tidyr   0.8.3     v stringr 1.4.0
## v readr   1.3.1     v forcats 0.4.0
## Warning: package 'ggplot2' was built under R version 3.5.3
## Warning: package 'tibble' was built under R version 3.5.3
## Warning: package 'tidyr' was built under R version 3.5.3
## Warning: package 'readr' was built under R version 3.5.3
## Warning: package 'purrr' was built under R version 3.5.3
## Warning: package 'dplyr' was built under R version 3.5.3
## Warning: package 'stringr' was built under R version 3.5.3
## Warning: package 'forcats' was built under R version 3.5.3
## -- Conflicts ------------------------------------------------------------------------ tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag()    masks stats::lag()
library(here)
## Warning: package 'here' was built under R version 3.5.3
## here() starts at Z:/Pers_Amalia/Screening/Image_analysis
library(heatmaply)
## Warning: package 'heatmaply' was built under R version 3.5.3
## Loading required package: plotly
## Warning: package 'plotly' was built under R version 3.5.3
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
## Loading required package: viridis
## Loading required package: viridisLite
## 
## ======================
## Welcome to heatmaply version 0.16.0
## 
## Type citation('heatmaply') for how to cite the package.
## Type ?heatmaply for the main documentation.
## 
## The github page is: https://github.com/talgalili/heatmaply/
## Please submit your suggestions and bug-reports at: https://github.com/talgalili/heatmaply/issues
## Or contact: <tal.galili@gmail.com>
## ======================

First, we load the data. To produce the small tidy table, run the load and process data script in Olaf. The data is aprox. 8 Gb and can’t be loaded into memory in my laptop at least.

# # k = 1
# j = 1
# todo = list()
# columns_i_like <- c(4,7,36,39,62,63)
# for(i in round(seq(1,4098628, length.out = 1000),0))
# {
#   
#   todo[[k]] <- read.csv(here('second_round_imaging','small_tidy_results.csv'), nrow = 10000, skip =i, header = FALSE)[, columns_i_like]
#   print(i)
#   k = k+1
# }

screen_data <- read_delim(here('second_round_imaging','extract_tidy.txt'), delim = ' ')
## Parsed with column specification:
## cols(
##   Metadata_Plate_Name = col_character(),
##   AreaShape_Area = col_double(),
##   Well = col_character(),
##   Time = col_double(),
##   TIME = col_double(),
##   Systematic = col_character(),
##   ID = col_character()
## )
## Warning: 4098627 parsing failures.
## row col  expected    actual                                                                            file
##   1  -- 7 columns 6 columns 'Z:/Pers_Amalia/Screening/Image_analysis/second_round_imaging/extract_tidy.txt'
##   2  -- 7 columns 6 columns 'Z:/Pers_Amalia/Screening/Image_analysis/second_round_imaging/extract_tidy.txt'
##   3  -- 7 columns 6 columns 'Z:/Pers_Amalia/Screening/Image_analysis/second_round_imaging/extract_tidy.txt'
##   4  -- 7 columns 6 columns 'Z:/Pers_Amalia/Screening/Image_analysis/second_round_imaging/extract_tidy.txt'
##   5  -- 7 columns 6 columns 'Z:/Pers_Amalia/Screening/Image_analysis/second_round_imaging/extract_tidy.txt'
## ... ... ......... ......... ...............................................................................
## See problems(...) for more details.
sum_data <- screen_data %>%
  group_by(Systematic, Time) %>%
  summarise(mean_size = median(AreaShape_Area)) %>%
  spread(key = Time, value = mean_size)

heatmaply(sum_data[,-1],Colv = FALSE)